package com.database.daos.imp;

import java.util.List;

import org.springframework.transaction.annotation.*;

import com.database.daos.IDeveloperDao;
import com.database.objects.Developer;

public class DeveloperDao extends GenericDao<Developer> implements IDeveloperDao {

	private static final long serialVersionUID = -1923414550418135372L;

	@Override
	@SuppressWarnings("unchecked")
	@Transactional(propagation = Propagation.REQUIRED)
	public Developer getById(Integer id) {
		List<Developer> developers = findByNamedQueryAndNamedParam("Developer.getById", "id", id);
		return developers.isEmpty() ? null : developers.get(0);
	}

}
